<?
//include script to do user logins
include("login/authincludesessions.php");
?>

<html>

<?
	include("header.php");
	include("drawmap.php");
?>

<div id="rightpane">

<h2>Add new user</h2>

<?

if(!$session->logged_in)
{
	echo("<b>Note: You must be logged in to add a new node</b>");
}

?>

Note: Just click on the map, and the co-ordinates will automatically fill themselves in
<form name="userdata" method= 'get' action='doadduser.php' >

<table>
<tr><td>Name :</td><td> <input type= 'text' name= 'uname' value='New User'></td></tr>

<tr><td>Latitude :</td><td><input type= 'text' name= 'ulat' id='ulat' ></td></tr>

<tr><td>Longitude :</td><td> <input type= 'text' name= 'ulong' id='ulong' > </td></tr>

<tr><td>Ownerid : </td><td><input type= 'text' readonly='true' name= 'uownerid' value=<? echo("$session->username"); ?> > </td></tr>

<tr><td>Status : </td><td>
<select name="ustatus">
 <option value ="1">Interest</option>
 <option value ="2">Active Node</option>
</select>
</td></tr>

<tr><td>Description :</td><td> <input type= 'text' name= 'udescription' value='Interested Node'> </td></tr>

<tr><td>Address : </td><td><input type= 'text' name= 'uaddress' value='Adelaide, SA'> </td></tr>

<tr><td>Url:</td><td> <input type= 'text' name= 'uurl' value='www.safreenet.org'> </td></tr>

<tr><td>
<input type= 'hidden' name= 'commented' value= 'set' >
<input type= 'submit' value= 'Submit' >
</td></tr>

</form>
</table>

</td>
</tr>
</table>


<script type="text/javascript">
//<![CDATA[

var map = new GMap(document.getElementById("map"));
map.addControl(new GLargeMapControl());
map.addControl(new GMapTypeControl());
map.centerAndZoom(new GPoint(138.599981, -34.928615), 6);

//define rest of icon (except .image which is node dependent)
var baseIcon = new GIcon();
baseIcon.image = "http://labs.google.com/ridefinder/images/mm_20_red.png";
baseIcon.shadow = "http://labs.google.com/ridefinder/images/mm_20_shadow.png";
baseIcon.iconSize = new GSize(12, 20);
baseIcon.shadowSize = new GSize(22, 20);
baseIcon.iconAnchor = new GPoint(6, 20);
baseIcon.infoWindowAnchor = new GPoint(5, 1);


// click to see where you are
//based on code from http://www.garshol.priv.no/blog/17.html
GEvent.addListener(map, 'click', function(overlay, GLatLng) {
 if (GLatLng) {
  document.getElementById('ulong').value=GLatLng.x;
  document.getElementById("ulong").value='hi';
  userdata.ulat.value=GLatLng.y;
 }
});


<?
	include("./includes/plotnodes.php");
?>

// click to see where you are
//based on code from http://www.garshol.priv.no/blog/17.html
GEvent.addListener(map, 'click', function(overlay, GLatLng) {
 if (GLatLng) {
  document.getElementById('ulong').value=GLatLng.x;
  document.getElementById('ulat').value=GLatLng.y;
 }
});

//]]>

</script>

</body>
</html>